﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using ZF.BLL.Page;
using ZF.Model;
using ZF.BLL;
using GCELibrary.Current;

namespace ZF.WS.info
{
    public partial class fitup : PageBase
    {
        public int TypeId { get; set; }
        [PageArgument(Key = "id", CanNull = false)]
        public int id { get; set; }
        public I_Fitup Model { get; set; }
        protected void Page_Load(object sender, EventArgs e)
        {
            using (var dc = SiteInfo.CreateDBDataContext())
            {
                var fitup = dc.I_Fitup.FirstOrDefault(p => p.FitupId == id);
                if (fitup == null)
                {
                    throw WarnFactory.CreateWarn(WarnCode.ReocrdNoFind);
                }
                this.Model = fitup;
                TypeId = fitup.TypeId;

              

            }
            using (var dc = SiteInfo.CreateDBDataContext())
            {
 

                //var isRecommendList = dc.SP_Merchandise.Where(p => p.IsRecommend && !p.IsDel).ToList().Select(p => new
                //{
                //    Merc = p,
                //    Photo = p.FirstPhoto,
                //}).Take(2).ToList();
                //this.lvIsRecommend.DataSource = isRecommendList;
                //this.lvIsRecommend.DataBind();

                //this.lvFitup.DataSource = dc.I_Fitup.Where(p => p.TypeId == TypeId).OrderByDescending(p => p.AddTime).Take(10).ToList();
                //this.lvFitup.DataBind();
            }
        }
    }
}
